﻿@{
    Layout = null;
    string docClsName = ViewData["docClsName"] == null ? "最新信息" : ViewData["docClsName"].ToString();
    string docClsCd = ViewData["docClsCd"] == null ? "" : ViewData["docClsCd"].ToString();
}
@using ElingOA6_DSJCJ.Models;
@using Webdiyer.WebControls.Mvc
@model Dictionary<string,List<ElingOA6_DSJCJ.Models.DocumentGridModel>>
@{
    Dictionary<string, string> dicDocClsNameList = ViewData["dicDocClsNameList"] == null ? new Dictionary<string, string>() : ViewData["dicDocClsNameList"] as Dictionary<string, string>;
   
}

@helper  GetConfigShowText(string keyName, Dictionary<string, string> dicDocClsNameList)
    {
        if (dicDocClsNameList.ContainsKey(keyName))
        {
    @:@dicDocClsNameList[keyName]
       }
    }

@helper  GetList(string keyName, Dictionary<string, List<ElingOA6_DSJCJ.Models.DocumentGridModel>> dicDocumentList,Dictionary<string, string> dicDocClsNameList,string width)
    {
        if (dicDocumentList.ContainsKey(keyName))
        {
            <div class="ztzl-div3" style="width:@width; height: 295px;">
        	    <div class="ztzl-title3"><span><a href="/Column/Sssc_List?clsCd=@keyName" target="_blank">更多</a></span><h3>@GetConfigShowText(keyName,dicDocClsNameList)</h3></div>
                <div class="ztzl-con3">
                    @{List<ElingOA6_DSJCJ.Models.DocumentGridModel> documentList = new List<DocumentGridModel>();
                            if (dicDocumentList.ContainsKey(keyName))
                            {
                                documentList = dicDocumentList[keyName];
                            }                           
                        foreach (DocumentGridModel documentModel in documentList)
                        {
                            <li><span>@documentModel.FPubDate.ToString("yyyy-MM-dd")</span><a href="/Column/Sssc_Detail?docId=@documentModel.FDocId" target="_blank" title="@documentModel.FTitle">@documentModel.FTitle</a></li>
                        }
                    }
                </div>
            </div>
        }
    }
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>@ElingOA6_DSJCJ.Common.GlobalConstant.CONSTRING_SYSTITLE</title>
 <link href="@Url.Content("~/Content/ztzl_css.css", true)" rel="stylesheet" type="text/css" />
 <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
  
</head>

<body>
<div class="ztzl-main">
    <div class="ztzl-header"><img src="@ViewData["logUrl"].ToString()" width="1000" height="226"/></div>
    
    @{
        if (dicDocClsNameList.Count > 0)
        {
                <div class="ztzl-nav3">
                <a href="/Column/Sssc?clsCd=@docClsCd">首页</a>
                @foreach(KeyValuePair<string,string> dicDocClsNameModel in dicDocClsNameList)
                {
                    <a href="/Column/Sssc_List?clsCd=@dicDocClsNameModel.Key">@dicDocClsNameModel.Value</a>
                } 
                </div>
        }
    }
    

    <div class="ztzl-maincon">
    @{
        List<string> dicDocumentKeyList = new List<string>(Model.Keys);

        int clsCount = dicDocumentKeyList.Count;
        for (int i = 0; i < dicDocumentKeyList.Count; i = i + 10)
        {
            if (clsCount - i == 1)
            {
                @*一行*@
                @GetList(dicDocumentKeyList[i], Model, dicDocClsNameList, "978px");
            }
            else
            {
                @*二行*@
                @GetList(dicDocumentKeyList[i], Model, dicDocClsNameList, "483px");
                @GetList(dicDocumentKeyList[i + 1], Model, dicDocClsNameList, "483px");
            }
            if (clsCount - i == 3)
            {
                 @*一行*@
                @GetList(dicDocumentKeyList[i + 2], Model, dicDocClsNameList, "978px");
            }
            else if (clsCount - i == 4)
            {
                 @*二行*@
                @GetList(dicDocumentKeyList[i + 2], Model, dicDocClsNameList, "483px");
                @GetList(dicDocumentKeyList[i + 3], Model, dicDocClsNameList, "483px");
            }
            else if (clsCount - i >= 5)
            {
                @*三行*@
                @GetList(dicDocumentKeyList[i + 2], Model, dicDocClsNameList, "318px");
                @GetList(dicDocumentKeyList[i + 3], Model, dicDocClsNameList, "318px");
                @GetList(dicDocumentKeyList[i + 4], Model, dicDocClsNameList, "318px");
            }


            if (clsCount - i == 6)
            {
                @*一行*@
                @GetList(dicDocumentKeyList[i + 5], Model, dicDocClsNameList, "978px");
            }
            else if (clsCount - i == 7)
            {
                @*二行*@
                @GetList(dicDocumentKeyList[i + 5], Model, dicDocClsNameList, "483px");
                @GetList(dicDocumentKeyList[i + 6], Model, dicDocClsNameList, "483px");
            }
            else if (clsCount - i >= 8)
            {
                @*三行*@
                @GetList(dicDocumentKeyList[i + 5], Model, dicDocClsNameList, "318px");
                @GetList(dicDocumentKeyList[i + 6], Model, dicDocClsNameList, "318px");
                @GetList(dicDocumentKeyList[i + 7], Model, dicDocClsNameList, "318px");
            }


            if (clsCount - i == 9)
            {
                @*一行*@
                @GetList(dicDocumentKeyList[i + 8], Model, dicDocClsNameList, "978px");
            }
            else if (clsCount - i >= 10)
            {
                @*二行*@
                @GetList(dicDocumentKeyList[i + 8], Model, dicDocClsNameList, "483px");
                @GetList(dicDocumentKeyList[i + 9], Model, dicDocClsNameList, "483px");
            }
        
        
        }   
    }
    </div>
    <div class="ztzl-bottom">@Html.Raw(ViewData["CopyRight"].ToString())</div>
</div>
</body>
</html>

